﻿#pragma once
#include "common_data.h"
#include <opencv2/opencv.hpp>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <QVector>

typedef pcl::PointXYZ PointT;
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

struct SKUPOSITION {
	QString GrabId;
	float SkuPosX;
	float SkuPosY;
	float SkuPosZ;
	float SkuPosZA;
	float SkuPosYA = 0.0;//拆码垛中正交角度
	float SkuPosXA = 0.0;//拆码垛中的正交角度
};

struct RECGRESULT
{
	QPoint P1;
	QPoint P2;
	QPoint P3;
	QPoint P4;
	int id = 0;
};

struct RECORDINFO
{
	RECGRESULT sult;
	int dx;
	int dy;

	float z;
	float za;
	bool btrue;
};

struct BoxInfo
{
	int length = 0;
	int width = 0;
	int id = 0;
	Position pos;
	PointCloud::Ptr cloud;
	QVector<int> child;
};

struct GrabInfo {
	int id;
	Position jigInsku;
	PointCloud::Ptr jigCloud;
	int socer; // 分数
};


#define INTRINSIC_FX "fx"
#define INTRINSIC_FY "fy"
#define INTRINSIC_CX "cx"
#define INTRINSIC_CY "cy"

#define EXTERNAL_00 "R_00"
#define EXTERNAL_01 "R_01"
#define EXTERNAL_02 "R_02"
#define EXTERNAL_03 "T_00"
#define EXTERNAL_10 "R_10"
#define EXTERNAL_11 "R_11"
#define EXTERNAL_12 "R_12"
#define EXTERNAL_13 "T_01"
#define EXTERNAL_20 "R_20"
#define EXTERNAL_21 "R_21"
#define EXTERNAL_22 "R_22"
#define EXTERNAL_23 "T_02"

#define JIGSETTING_TYPE "Type"
#define JIGSETTING_LOAD "Load"
#define JIGSETTING_LENGTH "Length"
#define JIGSETTING_WIDTH "Width"
#define JIGSETTING_HEIGHTGAP "HeightGap"

#define CALIBRATION_INS "Intrinsic"
#define CALIBRATION_EXT "External"
#define UNSTACKSPACE_LIMITS "UnstackSpace"

#define UNSTACKRESULT_POS "Position"
#define UNSTACKRESULT_SKUNUM "SkuNum"
#define UNSTACKRESULT_ARRANGEMENT "Arrangement"
#define UNSTACKRESULT_DELTAX "DeltaX"
#define UNSTACKRESULT_DELTAY "DeltaY"
#define INFO "Info"
#define RESULTIMAGE "ResultImage"

#define UNSTACK_LAYER_GAP 30

#define UNSTACK_ANGLE_THRE 3

#define DLL_PATH "SingleStack.dll"

#define STACK_GAP 1
#define STACK_HEIGHT 1500
#define STACK_SAFEGAP 30
#define PATHPOINT_FAST_ACC 30
#define PATHPOINT_FAST_VAL 30
#define PATHPOINT_FAST_SMOOTH 100
#define PATHPOINT_SLOW_ACC 30
#define PATHPOINT_SLOW_VAL 8
#define PATHPOINT_SLOW_SMOOTH 0

#define PCLFILTERS_LIMITS_XMAX 1000.0
#define PCLFILTERS_LIMITS_XMIN 500.0
#define PCLFILTERS_LIMITS_YMAX 1000.0
#define PCLFILTERS_LIMITS_YMIN 500.0
#define PCLFILTERS_LIMITS_ZMAX 1700.0
#define PCLFILTERS_LIMITS_ZMIN 1000.0

#define ALGORITHMCOMMON_LOG_MOUDLE "Algorithm"
#define ALGORITHMCOMMON_LOG_FILE "algorithmcommon.log"

#define ROBOT_HAND_SETTING_KEY_WORKZONE_XMAX "XMax"
#define ROBOT_HAND_SETTING_KEY_WORKZONE_XMIN "XMin"
#define ROBOT_HAND_SETTING_KEY_WORKZONE_YMAX "YMax"
#define ROBOT_HAND_SETTING_KEY_WORKZONE_YMIN "YMin"
#define ROBOT_HAND_SETTING_KEY_WORKZONE_ZMAX "ZMax"
#define ROBOT_HAND_SETTING_KEY_WORKZONE_ZMIN "ZMin"

#define PATHFIND_MINANGLE 60.0
